package com.zx.map.utils;

import com.zx.platform.utils.StrUtils;

import java.util.regex.Pattern;

/**
 * Created by bibei on 2017/2/13.
 */
public class MobileUtils {

	/**
	 * 验证手机号
	 *
	 * @param phone
	 * @return
	 */
	public static boolean isPhone(String phone) {
		String temp = phone;
		if (StrUtils.isEmpty(temp, false)) {
			return false;
		}
		if (temp.length() != 11) {
			return false;
		}
		Pattern p = Pattern.compile("^1\\d{10}$");
		return p.matcher(phone).matches();

	}

	public static boolean isNotPhone(String phone) {
		return !isPhone(phone);
	}
}
